<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    ul {
        list-style: none;
        display: flex;
        width: 1200px;
        margin: 0 auto;
    }

    li {
        width: 60px;
        height: 600px;
        transition: all .3s;
        background-color: red;
    }

    .li-main {
        width: 720px;
    }

    h1 {
        width: 60px;
        height: 600px;
        text-align: center;
        line-height: 60px;
        writing-mode: vertical-lr;
        letter-spacing: 10px;
        color: #fff;
        font-size: 24px;
        font-weight: 400;
    }

    .li-main>h1 {
        display: none;
    }

    .li-main .main {
        width: 100%;
        height: 100%;
    }

    .li-main .main h1 {
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 600px;
        writing-mode: horizontal-tb;
    }
</style>

<body>

    <ul> </ul>

    <script>

        const ul = document.getElementsByTagName('ul')[0]

        let arr1 = ['一', '二', '三', '四', '五', '六', '七']

        let arr2 = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'purple']

        for (let i = 0; i < 7; i++) {
            let li = document.createElement('li')
            li.style.backgroundColor = arr2[i]
            if (i === 0) li.classList.add('li-main')
            li.innerHTML = ` 
                <h1>内容${arr1[i]}</h1>
                <div class="main"><h1>内容${arr1[i]}</h1></div>
            `
            ul.appendChild(li)
        }

        const lis = Array.from(document.getElementsByTagName('li'))

        lis.forEach((v, i) => {
            v.onclick = () =>{
                document.getElementsByClassName('li-main')[0].classList.remove('li-main')
                v.classList.add('li-main')
            }
        })

    </script>
</body>

</html>